// Town script for town 3: Pilgrim's Rest

begintownscript;

variables;
int choice;
int tick3;

body;

beginstate INIT_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
if (get_flag(3,4) == 0) {
		message_dialog("Right, so this is Pilgrim's Rest. Seems rather deserted. The silence still persists and the streets and buildings are in a terrible state.","Should we be that surprised though? After the closing of the HMC, what work could the people here do? The HMC gave them work, some even a life. Many left town, probably, for the sole reason they needed work. Work was not here, so they went elsewhere.");
		set_flag(3,4,1);
		}

if (get_flag(3,18) == 0) {
		set_flag(3,18,1);
		tick3 = get_current_tick();
		set_flag(3,19,tick3 / 256);
		set_flag(3,20,tick3 % 256);
		}
break;

beginstate 10;
if (is_combat() == 0)
		move_to_new_town(2,4,16);

message_dialog("We can only go on when we have regrouped and are not fighting, so let's do that first.","");
block_entry(1);
break;

beginstate 11;
if (get_flag(3,0) == 0) {
		message_dialog("This house was abandoned. We step in and look around, only to find dust and cobwebs. The furniture is still here, though, which is a bit puzzling. Surely, if you move out, you take all your stuff with you?","");
		set_flag(3,0,1);
		}
break;

beginstate 12;
if (get_flag(3,1) == 0 && get_flag(2,1) == 0) {
		message_dialog("What's this? A roadblock of some kind it seems. For some reason, people dumped stones and wood here. To keep something out seems logical, but what? There are no wild animals, too silent for that.","");
		set_flag(3,1,1);
		}

if (get_flag(3,1) == 0 && get_flag(2,1) == 1) {
		message_dialog("What's this? A roadblock of some kind it seems. For some reason, people dumped stones and wood here. To keep something out seems logical, but what? There are no wild animals, too silent for that.","Makes us think of what we saw in that house, just outside Pilgrim's Rest. Perhaps they wanted to keep out whatever was at that house. Sure, could also have been bandits or something of the kind...");
		set_flag(3,1,1);
		}
break;

beginstate 13;
if (get_flag(3,2) == 0) {
		message_dialog("Something happened at the house in front of us. It's difficult to say, but it looks as though there was some explosion. The walls have collapsed and rubble is everywhere on the street.","It looks as though we can abandon our earlier thought about people _just leaving_ this town. Something forced them to leave.");
		set_flag(3,2,1);
		}
break;

beginstate 14;
if (get_flag(3,3) == 0) {
		if (get_flag(2,2) == 0) {
				message_dialog("Yeah, something forced them alright. This seems to be the main square, but it's covered with bones, blood and stones. People were fighting, fighting fiercely with a brutality and force we haven't come across often.","The traces of fight and carnage lead into the building to the west. The carnage aside, it must have been a fine looking building before its doorstep was colored red.");
				set_flag(3,3,1);
				}
		if (get_flag(2,2) == 1) {
				message_dialog("Yeah, something forced them alright. This seems to be the main square, but it's covered with bones, blood and stones. People were fighting, fighting fiercely, with the same brutality as that with which the person in that house was attacked.","The traces of fight and carnage lead into the building to the west. The carnage aside, it must have been a fine looking building before its doorstep was colored red.");
				set_flag(3,3,1);
				}
		}
break;

beginstate 15;
if (get_flag(3,5) == 0) {
		reset_dialog();
		add_dialog_str(0,"If we can believe what the sign outside said, this is the town hall, and it's a complete and utter mess. Stuff that wasn't absolutely pulverized has been strewn about.",0);
		add_dialog_str(1,"Who in his right mind could have done this? Even the cruelest of bandits wouldn't have had the chance to wreak such havoc on the main square. We would have heard wild animals if they had been here. That leaves us with nothing.",0);
		add_dialog_str(2,"Interestingly, there is a table blocking one of the doors. It's as if whoever was here, fighting for his life, tried to barricade the doors. He or she didn't succeed. This place was the last refuge. The grave of the last warriors.",0);
		add_dialog_str(3,"If that is true, then the fighting began somewhere deeper in town. We'll have to follow the road, along the barricades, blood and gore, if we want to know what happened here. Honestly, we'll have to follow it anyway if we want to escape this hellish pit.",0);
		add_dialog_choice(0,"Okay");
		choice = run_dialog(1);
		set_flag(3,5,1);
		}
break;

beginstate 16;
reset_dialog();
add_dialog_str(0,"We walk up to this message board. There are several notes here and one large plaque, which has been carefully fastened with screws. It warns travelers of bandit activity.",0);
if (get_flag(3,6) == 1) {
		add_dialog_str(1,"Since we've already read this sign, we learn nothing new.",0);
		}
if (get_flag(3,6) == 0 && get_flag(2,1) == 1) {
		add_dialog_str(1,"So apparently, there is a chance that bandits attacked the house we saw earlier. Whether the carnage on this square is also by these bandits we can't say. Probably not, but there is a slim chance.",0);
		set_flag(3,6,1);
		}
add_dialog_choice(0,"Okay");
choice = run_dialog(1);
break;

beginstate 17;
message_dialog("There are some small notes concerning festivities and the like, some note about a lost puppy and more trivial stuff. Interestingly, the posting dates mentioned on these notes are of days before the time the HMC got evacuated, not after.","");
set_flag(3,7,1);
break;

beginstate 18;
	if (get_flag(3,8) == 0) {
			message_dialog("If this indeed is Pilgrim's Rest's inn, then we can forget the comfort we had hoped for. There are no bodies, even though the inn looks like a battlefield.","From where we are, we can peek into the commons. The beds have been ripped apart and the whole room generally resembles a trash pit a lot more than it does an actual bedroom.");
			set_flag(3,8,1);
			}
break;

beginstate 19;
	if (get_flag(3,9) == 0) {
			message_dialog("The main streets here have been blocked by barricades. They were hastily made and don't look very sturdy. The attack must have been as sudden as it was ferocious.","The more we progress, the more there is to ponder about. What were these townspeople running for, and what could have been so aggressive a force that it could ram through boulders? What kind of beast was this...");
			set_flag(3,9,1);
			}
break;

beginstate 20;
	if (get_flag(3,10) == 0) {
			message_dialog("What a stench in this place! A smell of alcohol and filth. There are some shelves with bottles, and the table also is filled with empty or half-empty bottles. This place must have been the local drunkards' drinking place.","In a sad and funny way, whatever ravaged this town, it didn't enter here.");
			set_flag(3,10,1);
			}
break;

beginstate 21;
	if (get_flag(3,11) == 0) {
			message_dialog("The alley sort of ends here with a barricade. Judging by the blood, the townspeople tried hard to make sure whatever was coming wouldn't go through. Alas, it didn't really help.","");
			set_flag(3,11,1);
			}
break;

beginstate 22;
	if (get_flag(3,12) == 0) {
			reset_dialog();
			add_dialog_str(0,"What a mess. Again.",0);
			add_dialog_str(1,"Interestingly, the killer, or killers, came barging right through the door. There is a hole in the wall, and the one door that is left is wide open.",0);
			add_dialog_str(2,"While we stand around, pondering the situation, the silence comes to our attention again. Since the moment the dust started settling at the collapsed HMC, We have heard nothing but our own footsteps. Utter silence all the time, all around us.",0);
			add_dialog_choice(0,"Okay");
			choice = run_dialog(1);
			set_flag(3,12,1);
			}
break;

beginstate 23;
	if (get_flag(3,13) == 0) {
			message_dialog("Another barricade in this tiny alley. The owner of the house put an enormous boulder in front of his front door. Kept the beasts out, but did the guy came out alive ever again with that rock in front of the door? We won't know.","");
			set_flag(3,13,1);
			}
break;

beginstate 24;
	if (get_flag(3,14) == 0) {
			message_dialog("An old storage room. This whole complex is probably storage rooms. All of them probably as filthy and unkept as everything we have seen in this town.","Chances are slim, but maybe we will find something useful between the trash and filth.");
			set_flag(3,14,1);
			}
break;

beginstate 25;
	if (get_flag(3,15) == 0) {
			message_dialog("Viewing the barricade from the other side, we can see just how they made it. They simply blew up a house and used its rubble to make the barricade. All that hard work, and then forget there is a back alley. It's so sad that it's almost funny.","Closer look reveals that there are some nails and teeth marks, but not many. That makes the situation even sadder, since apparently, whatever came here, it found the alley rather quickly.");
			set_flag(3,15,1);
			}
break;

beginstate 26;
	if (get_flag(3,16) == 0) {
			message_dialog("The last hiding place: the mayor's office. Whoever was hiding here could not have run anywhere. The walls have partially collapsed, the door has been banged open. Body parts on the floor and blood everywhere. A gruesome sight.","What an extreme fright it must have been to be in this room, knowing that you will be killed in a gruesome way. You know there is a wolf at the door, but you don't know when it'll come in to get you.");
			set_flag(3,16,1);
			}
break;

beginstate 27;
	if (get_flag(3,17) == 0) {
			message_dialog("This shop has been cleared out thoroughly. Everything is empty and a thick layer of dust has settled. It looks as though the owners knew what was coming and left this place just in time.","");
			set_flag(3,17,1);
			}
break;

beginstate 28;
if (is_combat() == 0)
		move_to_new_town(4,24,5);

message_dialog("We can only go on when we have regrouped and are not fighting, so let's do that first.","");
block_entry(1);
break;